function p = binary_search(A,f,l,precise)
y = [polyval(A,f), polyval(A,l)];
while l-f > precise
    temp = (f+l)/2;
    if polyval(A,temp) == 0
        p = temp;
        return
    elseif polyval(A,f)*polyval(A,temp) < 0
        l = temp;
    elseif polyval(A,f)*polyval(A,temp) > 0
        f = temp;
    end
end
digits(20)
p = (f+l)/2;
end